package com.itheima.mp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.mp.domain.dto.PageDTO;
import com.itheima.mp.domain.po.User;
import com.itheima.mp.domain.query.UserQuery;
import com.itheima.mp.domain.vo.UserVO;

import java.util.List;

/**
 * ClassName: IUserService
 * Package: com.itheima.mp.service
 * Description:
 *
 * @Author zt
 * @Create 2025/9/16 15:23
 * @Version 1.0
 */
public interface IUserService extends IService<User> {
    /**
     * 扣减余额
     * @param id
     * @param money
     */
    void deductBalance(Long id, Integer money);

    /**
     * 根据条件查询用户
     * @param name
     * @param status
     * @param minBalance
     * @param maxBalance
     * @return
     */
    List<User> queryUsers(String name, Integer status, Integer minBalance, Integer maxBalance);

    /**
     * 根据id查询用户和地址
     * @param id
     * @return
     */
    UserVO queryUserAndAddressById(Long id);

    /**
     * 根据id批量查询
     * @param ids
     * @return
     */
    List<UserVO> queryUserAndAddressByIds(List<Long> ids);

    /**
     * 分页查询用户
     * @param query
     * @return
     */
    PageDTO<UserVO> queryUsersPage(UserQuery query);
}
